From e4088d5adda0028c333b6ca4ae75b877af99c4a6 Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 7 May 2006 02:14:34 +0000 Subject: [PATCH] Make shapefile and all palm pdb formats deselectable at build time. --- cetus.c | 2 ++ coldsync/pdb.c | 5 ++++- coldsync/util.c | 5 ++++- config.h.in | 8 +++++++- configure | 18 ++++++++++++------ configure.in | 11 ++++++----- copilot.c | 2 ++ coto.c | 3 ++- gcdb.c | 2 ++ geoniche.c | 2 ++ gpilots.c | 2 ++ gpspilot.c | 2 ++ mag_pdb.c | 2 ++ magnav.c | 2 ++ mapopolis.c | 2 ++ palmdoc.c | 2 ++ pathaway.c | 2 ++ quovadis.c | 2 ++ shape.c | 2 ++ shapelib/dbfopen.c | 11 +++++++++-- shapelib/shpopen.c | 10 ++++++++-- vecs.c | 16 ++++++++++++++++ 22 files changed, 94 insertions(+), 19 deletions(-) diff --git a/cetus.c b/cetus.c index d7ba2de61..28042607c 100644 --- a/cetus.c +++ b/cetus.c @@ -29,6 +29,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" # @@ -641,3 +642,4 @@ ff_vecs_t cetus_vecs = { cetus_args, CET_CHARSET_MS_ANSI, 0 /* CET-REVIEW */ }; +#endif diff --git a/coldsync/pdb.c b/coldsync/pdb.c index 3ad5e2a57..9253a9038 100644 --- a/coldsync/pdb.c +++ b/coldsync/pdb.c @@ -6,7 +6,7 @@ * You may distribute this file under the terms of the Artistic * License, as specified in the README file. * - * $Id: pdb.c,v 1.10 2006/04/09 02:11:34 robertl Exp $ + * $Id: pdb.c,v 1.11 2006/05/07 02:14:35 robertl Exp $ */ /* XXX - The way zero-length records are handled is a bit of a kludge. They * shouldn't normally exist, with the exception of expunged records. But, @@ -21,6 +21,8 @@ * with them. * Debugging messages should go to 'FILE *pdb_logfile'. */ +#include "config.h" +#if PDBFMTS_ENABLED #include "cs-config.h" #include @@ -2029,3 +2031,4 @@ pdb_LoadRecords(int fd, * fill-column: 75 *** * End: *** */ +#endif /* PDBFMTS_DISABLED */ diff --git a/coldsync/util.c b/coldsync/util.c index 318a86e28..3afb545d7 100644 --- a/coldsync/util.c +++ b/coldsync/util.c @@ -12,10 +12,12 @@ * native format, convert them to Palm (big-endian) format, and write * them to a ubyte string. * - * $Id: util.c,v 1.5 2006/04/09 02:11:34 robertl Exp $ + * $Id: util.c,v 1.6 2006/05/07 02:14:35 robertl Exp $ */ +#include "config.h" #include "cs-config.h" +#if PDBFMTS_ENABLED #include #include /* For isprint() */ #include @@ -288,3 +290,4 @@ debug_dump(FILE *outfile, const char *prefix, * fill-column: 75 *** * End: *** */ +#endif diff --git a/config.h.in b/config.h.in index e20a847d6..10b5f9b90 100644 --- a/config.h.in +++ b/config.h.in @@ -1,6 +1,6 @@ /* config.h.in. Generated from configure.in by autoheader. */ -/* "0 for most-used character sets" */ +/* 0 for most-used character sets */ #undef CET_WANTED /* Defined if you have libexpat */ @@ -32,3 +32,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION + +/* 1 to enable Palm PDB support */ +#undef PDBFMTS_ENABLED + +/* 1 to enable shapefile support */ +#undef SHAPELIB_ENABLED diff --git a/configure b/configure index 12a679727..bd7f8d731 100755 --- a/configure +++ b/configure @@ -2521,6 +2521,17 @@ _ACEOF fi + +cat >>confdefs.h <<\_ACEOF +#define SHAPELIB_ENABLED 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define PDBFMTS_ENABLED 1 +_ACEOF + + case "$target" in *-*-cygwin* | *-*-mingw32*) if test "$with_libusb" = no ; then @@ -2919,9 +2930,7 @@ fi done -# coldsync, shapelib, and jeeps are here just so the target directories are -# created. - ac_config_files="$ac_config_files Makefile shapelib/Makefile coldsync/Makefile jeeps/Makefile" + ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3449,9 +3458,6 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "shapelib/Makefile" ) CONFIG_FILES="$CONFIG_FILES shapelib/Makefile" ;; - "coldsync/Makefile" ) CONFIG_FILES="$CONFIG_FILES coldsync/Makefile" ;; - "jeeps/Makefile" ) CONFIG_FILES="$CONFIG_FILES jeeps/Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} diff --git a/configure.in b/configure.in index 6047dba63..52f61da62 100644 --- a/configure.in +++ b/configure.in @@ -24,11 +24,14 @@ AC_ARG_WITH(cet,[--with-cet=(default,all,minimal)], cet="$withval", cet="default") if test "$cet" = "all"; then - AC_DEFINE(CET_WANTED, 1, "1 for all character sets") + AC_DEFINE(CET_WANTED, 1, [1 for all character sets]) fi if test "$cet" = "default"; then - AC_DEFINE(CET_WANTED, 0, "0 for most-used character sets") + AC_DEFINE(CET_WANTED, 0, [0 for most-used character sets]) fi + +AC_DEFINE(SHAPELIB_ENABLED, 1, [1 to enable shapefile support]) +AC_DEFINE(PDBFMTS_ENABLED, 1, [1 to enable Palm PDB support]) case "$target" in *-*-cygwin* | *-*-mingw32*) @@ -135,7 +138,5 @@ AC_SUBST(EXPAT_LIB) # AC_CHECK_FUNCS([atexit floor localtime_r memmove memset pow select sqrt strchr strcspn strdup strerror strncasecmp strrchr strspn strstr strtol strtoul]) AC_CHECK_FUNCS([nanosleep sleep]) -# coldsync, shapelib, and jeeps are here just so the target directories are -# created. -AC_CONFIG_FILES([Makefile shapelib/Makefile coldsync/Makefile jeeps/Makefile]) +AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/copilot.c b/copilot.c index 879d49a9b..b1b1c903b 100644 --- a/copilot.c +++ b/copilot.c @@ -20,6 +20,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" #include "grtcirc.h" @@ -202,3 +203,4 @@ ff_vecs_t copilot_vecs = { NULL, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/coto.c b/coto.c index 38e5e3ff1..c5dfc59f4 100644 --- a/coto.c +++ b/coto.c @@ -22,9 +22,9 @@ */ -#include #include "defs.h" +#if PDBFMTS_ENABLED #include "csv_util.h" #include "coldsync/palm.h" #include "coldsync/pdb.h" @@ -456,3 +456,4 @@ ff_vecs_t coto_vecs = { coto_args, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/gcdb.c b/gcdb.c index df49107d0..aeb6723f1 100644 --- a/gcdb.c +++ b/gcdb.c @@ -20,6 +20,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" @@ -342,3 +343,4 @@ ff_vecs_t gcdb_vecs = { NULL, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/geoniche.c b/geoniche.c index b374a4e62..79c5737ff 100644 --- a/geoniche.c +++ b/geoniche.c @@ -21,6 +21,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" #include "jeeps/gpsmath.h" @@ -814,3 +815,4 @@ ff_vecs_t geoniche_vecs = Args, CET_CHARSET_MS_ANSI, 0 /* CET-REVIEW */ }; +#endif diff --git a/gpilots.c b/gpilots.c index 6444e651d..d15430ba4 100644 --- a/gpilots.c +++ b/gpilots.c @@ -20,6 +20,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" #include "garmin_tables.h" @@ -460,3 +461,4 @@ ff_vecs_t gpilots_vecs = { my_args, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/gpspilot.c b/gpspilot.c index 8a5de41a1..704f72e8a 100644 --- a/gpspilot.c +++ b/gpspilot.c @@ -20,6 +20,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" @@ -258,3 +259,4 @@ ff_vecs_t gpspilot_vecs = { gpspilot_args, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/mag_pdb.c b/mag_pdb.c index 986f9b0ac..1b4ff54c7 100644 --- a/mag_pdb.c +++ b/mag_pdb.c @@ -25,6 +25,7 @@ #include #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" #include "jeeps/gpsmath.h" @@ -239,3 +240,4 @@ ff_vecs_t magpdb_vecs = { magpdb_args, CET_CHARSET_MS_ANSI, 1 /* CET-REVIEW */ }; +#endif diff --git a/magnav.c b/magnav.c index 2d0193d97..dc9af4961 100644 --- a/magnav.c +++ b/magnav.c @@ -20,6 +20,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" @@ -274,3 +275,4 @@ ff_vecs_t magnav_vec = { NULL, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/mapopolis.c b/mapopolis.c index 2be3bbb10..151cc7d99 100644 --- a/mapopolis.c +++ b/mapopolis.c @@ -20,6 +20,7 @@ */ #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" @@ -320,3 +321,4 @@ ff_vecs_t mapopolis_vecs = { NULL, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/palmdoc.c b/palmdoc.c index 5d1cd679f..cea685f50 100644 --- a/palmdoc.c +++ b/palmdoc.c @@ -23,6 +23,7 @@ #include "defs.h" +#if PDBFMTS_ENABLED #include "jeeps/gpsmath.h" #include #include "coldsync/palm.h" @@ -628,3 +629,4 @@ ff_vecs_t palmdoc_vecs = { }; +#endif diff --git a/pathaway.c b/pathaway.c index 326761b16..a8119e9a8 100644 --- a/pathaway.c +++ b/pathaway.c @@ -28,6 +28,7 @@ #include #include "defs.h" +#if PDBFMTS_ENABLED #include "coldsync/palm.h" #include "coldsync/pdb.h" #include "csv_util.h" @@ -693,3 +694,4 @@ ff_vecs_t ppdb_vecs = { ppdb_args, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/quovadis.c b/quovadis.c index 51d7043c5..cefa44d8e 100644 --- a/quovadis.c +++ b/quovadis.c @@ -21,6 +21,7 @@ #include "quovadis.h" +#if PDBFMTS_ENABLED static FILE *file_in; static FILE *file_out; static const char *out_fname; @@ -296,3 +297,4 @@ ff_vecs_t quovadis_vecs = { quovadis_args, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif diff --git a/shape.c b/shape.c index 5084f58d8..4d4c03d52 100644 --- a/shape.c +++ b/shape.c @@ -22,6 +22,7 @@ #include "defs.h" #include "shapelib/shapefil.h" +#if SHAPELIB_ENABLED static SHPHandle ihandle; static DBFHandle ihandledb; static SHPHandle ohandle; @@ -312,3 +313,4 @@ ff_vecs_t shape_vecs = { shp_args, CET_CHARSET_ASCII, 0 /* CET-REVIEW */ }; +#endif /* SHAPELIB_ENABLED */ diff --git a/shapelib/dbfopen.c b/shapelib/dbfopen.c index a6a0be543..830a5be71 100644 --- a/shapelib/dbfopen.c +++ b/shapelib/dbfopen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: dbfopen.c,v 1.1 2004/09/20 17:21:22 robertl Exp $ + * $Id: dbfopen.c,v 1.2 2006/05/07 02:14:35 robertl Exp $ * * Project: Shapelib * Purpose: Implementation of .dbf access API documented in dbf_api.html. @@ -34,6 +34,9 @@ ****************************************************************************** * * $Log: dbfopen.c,v $ + * Revision 1.2 2006/05/07 02:14:35 robertl + * Make shapefile and all palm pdb formats deselectable at build time. + * * Revision 1.1 2004/09/20 17:21:22 robertl * Check in shapelib and experimental prototype of crude shapefile support. * @@ -186,9 +189,12 @@ */ static char rcsid[] = - "$Id: dbfopen.c,v 1.1 2004/09/20 17:21:22 robertl Exp $"; + "$Id: dbfopen.c,v 1.2 2006/05/07 02:14:35 robertl Exp $"; #include "shapefil.h" +#include "config.h" + +#if SHAPELIB_ENABLED #include #include @@ -1496,3 +1502,4 @@ DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName) } return(-1); } +#endif diff --git a/shapelib/shpopen.c b/shapelib/shpopen.c index 54d04a5dc..711991816 100644 --- a/shapelib/shpopen.c +++ b/shapelib/shpopen.c @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: shpopen.c,v 1.2 2004/09/27 01:13:58 robertl Exp $ + * $Id: shpopen.c,v 1.3 2006/05/07 02:14:35 robertl Exp $ * * Project: Shapelib * Purpose: Implementation of core Shapefile read/write functions. @@ -34,6 +34,9 @@ ****************************************************************************** * * $Log: shpopen.c,v $ + * Revision 1.3 2006/05/07 02:14:35 robertl + * Make shapefile and all palm pdb formats deselectable at build time. + * * Revision 1.2 2004/09/27 01:13:58 robertl * warning fixes in shapelib. From Alexander Stohr. * @@ -165,9 +168,11 @@ */ static char rcsid[] = - "$Id: shpopen.c,v 1.2 2004/09/27 01:13:58 robertl Exp $"; + "$Id: shpopen.c,v 1.3 2006/05/07 02:14:35 robertl Exp $"; #include "shapefil.h" +#include "config.h" +#if SHAPELIB_ENABLED #include #include @@ -1870,3 +1875,4 @@ SHPRewindObject( SHPHandle hSHP, SHPObject * psObject ) return bAltered; } +#endif diff --git a/vecs.c b/vecs.c index 6c7fd87c7..d1fe8d628 100644 --- a/vecs.c +++ b/vecs.c @@ -178,6 +178,7 @@ vecs_t vec_list[] = { "Lowrance USR", "usr" }, +#if PDBFMTS_ENABLED { &cetus_vecs, "cetus", @@ -202,6 +203,7 @@ vecs_t vec_list[] = { "Magellan NAV Companion for Palm/OS", "pdb" }, +#endif /* PDBFMTS_ENABLED */ { &garmin_vecs, "garmin", @@ -232,12 +234,14 @@ vecs_t vec_list[] = { "TopoMapPro Places File", "tmpro" }, +#if PDBFMTS_ENABLED { &gcdb_vecs, "gcdb", "GeocachingDB for Palm/OS", "pdb" }, +#endif { &tiger_vecs, "tiger", @@ -250,6 +254,7 @@ vecs_t vec_list[] = { "EasyGPS binary format", ".loc" }, +#if PDBFMTS_ENABLED { &quovadis_vecs, "quovadis", @@ -262,6 +267,7 @@ vecs_t vec_list[] = { "GpilotS", "pdb" }, +#endif { &saroute_vecs, "saroute", @@ -286,6 +292,7 @@ vecs_t vec_list[] = { "KuDaTa PsiTrex text", NULL }, +#if SHAPELIB_ENABLED { &shape_vecs, "shape", @@ -298,6 +305,7 @@ vecs_t vec_list[] = { "GeoNiche .pdb", "pdb" }, +#endif { &gpl_vecs, "gpl", @@ -328,12 +336,14 @@ vecs_t vec_list[] = { "HTML Output", "html" }, +#if PDBFMTS_ENABLED { &palmdoc_vecs, "palmdoc", "PalmDoc Output", "pdb" }, +#endif { &netstumbler_vecs, "netstumbler", @@ -418,12 +428,14 @@ vecs_t vec_list[] = { "Map&Guide 'TourExchangeFormat' XML", "xml" }, +#if PDBFMTS_ENABLED { &ppdb_vecs, "pathaway", "PathAway Database for Palm/OS", "pdb" }, +#endif { &vitosmt_vecs, "vitosmt", @@ -448,12 +460,14 @@ vecs_t vec_list[] = { "Motorrad Routenplaner (Map&Guide) .bcr files", "bcr" }, +#if PDBFMTS_ENABLED { &coto_vecs, "coto", "cotoGPS for Palm/OS", "pdb" }, +#endif { &ignr_vecs, "ignrando", @@ -490,12 +504,14 @@ vecs_t vec_list[] = { "Navigon Mobile Navigator .rte files", "rte" }, +#if PDBFMTS_ENABLED { &magpdb_vecs, "mag_pdb", "Map&Guide to Palm/OS exported files (.pdb)", "pdb" }, +#endif { &compegps_vecs, "compegps", -- 2.30.2